package com.books.service.order.impl;


import com.books.mapper.common.PeopleMapper;
import com.books.mapper.common.VipMapper;
import com.books.mapper.order.BuyOrderMapper;
import com.books.model.entity.backcontroller.Vip;
import com.books.model.entity.order.BuyOrder;
import com.books.service.order.IBuyOrderServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ZhouRui
 * @title: 码上就来
 * @projectName cbstore-spring-boot
 * @description: TODO
 * @date 2021/10/1114:09
 */
@Service
@Transactional
public class BuyOrderServerImpl implements IBuyOrderServer {
    @Autowired(required = false)
    private BuyOrderMapper buyOrderMapper;

    @Override
    public void addOrder(BuyOrder buyOrder) {
        buyOrderMapper.insert(buyOrder);
    }

    @Override
    public BuyOrder findOneOrder(String buyId) {
        BuyOrder buyOrder = buyOrderMapper.findOneOrder(buyId);
        return buyOrder;
    }

    @Override
    public List<BuyOrder> findAllOrder(Integer userId) {
        List<BuyOrder> buyOrders = buyOrderMapper.findAllOrder(userId);
        return buyOrders;
    }
}
